-- GENERATED SPELL FOR [The Duke of Zephyrs] --


function spell0_15220(pUnit, Event) --@Elemental Spawn-in,Self--
pUnit:FullCastSpellOnTarget(25035,pUnit)
pUnit:RegisterEvent('Sorts_15220', 651, 1)
end

function spell1_15220(pUnit, Event) --@Enveloping Winds,n/a--
pUnit:FullCastSpellOnTarget(15535,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15220', 12000, 1)
end

function spell2_15220(pUnit, Event) --@Forked Lightning,n/a--
pUnit:FullCastSpellOnTarget(25034,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15220', 2000, 1)
end

function spell3_15220(pUnit, Event) --@Lightning Cloud,n/a--
pUnit:FullCastSpellOnTarget(44417,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15220', 14000, 1)
end

function spell4_15220(pUnit, Event) --@Wing Flap,Self--
pUnit:FullCastSpellOnTarget(12882,pUnit)
pUnit:RegisterEvent('Sorts_15220', 579, 1)
end

function Sorts_15220(pUnit, Event)
local choix_sorts_15220 = math.random(0, 4)
if choix_sorts_15220 == 0 then
pUnit:RegisterEvent('spell0_15220', 1, 1)
end
if choix_sorts_15220 == 1 then
pUnit:RegisterEvent('spell1_15220', 1, 1)
end
if choix_sorts_15220 == 2 then
pUnit:RegisterEvent('spell2_15220', 1, 1)
end
if choix_sorts_15220 == 3 then
pUnit:RegisterEvent('spell3_15220', 1, 1)
end
if choix_sorts_15220 == 4 then
pUnit:RegisterEvent('spell4_15220', 1, 1)
end
end

function mob15220_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15220', math.random(1500, 3000), 1)
end

function mob15220_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15220_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15220_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15220, 1, 'mob15220_Action')
RegisterUnitEvent(15220, 2, 'mob15220_Leave')
RegisterUnitEvent(15220, 3, 'mob15220_Kill')
RegisterUnitEvent(15220, 4, 'mob15220_Die')
